package com.tourlaid.mamagerment.mapper

import com.tourlaid.mamagerment.dto.CommentDto
import com.tourlaid.mamagerment.dto.MyCommentDto
import com.tourlaid.mamagerment.entity.Comment
import org.apache.ibatis.annotations.Param

/**
 * Created by xiaoyongge on 2017/7/19.
 */

interface CommentMapper {

    fun getById(id: Long): Comment

    fun insert(record: Comment)

    fun queryOtherCByThoughtId(@Param("toUserId") toUserId: Long, @Param("thoughtId") thoughtId: Long): List<CommentDto>

    fun queryWeCByThoughtId(@Param("fromUserId") fromUserId: Long,
                            @Param("toUserId") toUserId: Long,
                            @Param("thoughtId") thoughtId: Long): List<Comment>

    fun delete(@Param("id") id: Long, @Param("editor") editor: Long?)

    fun queryByThoughtId(@Param("thoughtId") thoughtId: Long): List<Comment>

    fun queryByFromUserId(@Param("fromUserId") fromUserId: Long): List<MyCommentDto>

    fun queryByToUserId(@Param("toUserId") toUserId: Long): List<MyCommentDto>
}